package cn.nicklemay.interview.designpattern.proxy;

public class ProxyObject implements AbstractObject {
    private RealObject realObject = new RealObject();

    @Override
    public void say() {
        //调用目标对象之前可以做相关操作
        System.out.println("before realObject");
        realObject.say();
        //调用目标对象之后可以做相关操作
        System.out.println("after realObject");
    }

    public static void main(String[] args) {
        AbstractObject abstractObject = new ProxyObject();
        abstractObject.say();
    }
}
